package ink.ykb.demo.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.format.FormatterRegistry;
import org.springframework.format.datetime.DateFormatter;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


@Configuration
public class MvcConfig implements WebMvcConfigurer{

	@Value("${spring.jackson.date-format}")
	private String dateFormat;

	/**
	 * 格式化
	 */
	@Override
	public void addFormatters(FormatterRegistry registry) {
		
		registry.addFormatter(new DateFormatter(dateFormat));
		
	}



}
